from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import  By
from selenium.common.exceptions import NoSuchElementException
wd = webdriver.Chrome(service=Service(r'/Users/tonywu/downloads/Mess/chromedriver/chromedriver'))
wd.get("http://www.baidu.com")
try:
    element = wd.find_element(By.CSS_SELECTOR,'#kw')
    element.send_keys('翁帆\n')
    # search = wd.find_element(By.ID, 'su')
    # search.click()
except NoSuchElementException as e:
    print(e.msg)
input()